#include <QThread>
#include <QDebug>
#include <QCoreApplication>
#include "cap_thread.h"
cap_thread::cap_thread (std::function<void (void)> runner,QObject * p)
	:QThread(p)
	,m_runner(runner)

{

}
cap_thread::cap_thread (QObject * p)
	:QThread(p)

{

}

void cap_thread::run()
{
	if (m_runner)
		m_runner();
}

/* example:
int main(int argc, char *argv[])
{
	QCoreApplication a(argc, argv);
	std::function<void (void)> runner = [](){
		qDebug() << "hello world";
	};
	cap_thread t(runner);
	t.start();
	t.join();
	return 0;//a.exec();
	
		
};
*/